package com.project.controller;

import com.project.bean.InfoBean;
import com.project.bean.MovieBean;

import com.project.remoteService.IInfoService;
import com.project.service.IMovieService;

import com.project.service.RabbitMQService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("movie")
public class MovieController {
    @Autowired
    private IMovieService service;

    @Autowired
    IInfoService infoService;


    @PostMapping("add")
    public String add(@RequestBody MovieBean movie){
        service.add(movie);
        return "ok";
    }

     @GetMapping("findByName/{name}")
    public List<MovieBean> findByName(@PathVariable("name") String name){
        return service.findByName(name);
     }




}
